package com.frame.jfinal.validator;

import com.jfinal.core.Controller;
import com.jfinal.ext.render.CaptchaRender;
import com.jfinal.validate.Validator;
import com.system.model.User;

/**
 * @author LRC
 * @createDate 2015年5月24日
 * @description 注册验证
 */
public class RegisterValidator extends Validator{
	public static int maxFailedNum = 5;
	@Override
	protected void validate(Controller c) {
		String type = c.getPara("type");
		if("5o+Q5Lqk55CD5Zy6566h55CG5rOo5YaM".equals(type)){
			//进行球场管理注册验证
			validateString("userCode", 6, 20, "msg", "注册提交的参数异常！");
			validateString("password", 6, 100, "msg", "注册提交的参数异常！");
			validateRequired("email", "msg", "注册提交的参数异常！");
			validateRequired("userName", "msg", "注册提交的参数异常！");
			validateRequired("telephone", "msg", "注册提交的参数异常！");
		}
	}

	@Override
	protected void handleError(Controller c) {
		c.renderJson();
	}


}
